
package kr.hkit.androidcomplete01.ch12;

import kr.hkit.androidcomplete01.R;
import kr.hkit.androidcomplete01.ch06.CodeLayout;
import kr.hkit.androidcomplete01.ch06.Inflation;
import kr.hkit.androidcomplete01.ch06.Inflation2;
import kr.hkit.androidcomplete01.ch06.Inflation3;
import kr.hkit.androidcomplete01.ch06.LayoutParameter;
import kr.hkit.androidcomplete01.ch06.MarginParameter;
import kr.hkit.androidcomplete01.ch06.MultiPage;
import kr.hkit.androidcomplete01.ch06.SetParameter;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Ch12Main extends ListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		/*subList = getResources().getStringArray(R.array.ch12_list);

		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, subList);*/
		
		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.ch12_list, android.R.layout.simple_list_item_1);
		setListAdapter(adapter);
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		Intent intent = null;

		switch (position) {
		case 0:
			intent = new Intent(this, ListViewCode.class);
			break;
		case 1:
			intent = new Intent(this, ListViewXml.class);
			break;
		case 2:
			intent = new Intent(this, ListItemSelect.class);
			break;
		case 3:
			intent = new Intent(this, ListAddDelSingleChoice.class);
			break;
		case 4:
			intent = new Intent(this, ListAddDelMulti.class);
			break;
		case 5:
			intent = new Intent(this, Expandable.class);
			break;
		case 6:
			intent = new Intent(this, SpinnerTest.class);
			break;
		}
		startActivity(intent);
		
	}
}